﻿@using Kevin.Shop.Business.Service.Entity.Helper
@model List<RiderShop.Mobile.ServiceEntity.MyAccount.UserShipingAddressExtend>
@section header
{
<link href="~/Themes/RongJi/Style/plugins/fastconfirm/jquery.fastconfirm.css" rel="stylesheet">
<link href="~/Themes/RongJi/Style/base/css/account.css" rel="stylesheet">
}
@section title
{
    我的收货地址
}
<div id="equalize">
    @{
        Html.RenderPartial("MenuPartial");
    }
    <div class="col-right">
        <div class="wrapper-right">
            <header class="accountHeader">
                <i class="zhi"></i>
                <h2>收货地址</h2>
            </header>
            <div class="addNewAddressBar"><a class="addNewAddress" href="#ShippingAddressCreator"><i class="fa fa-plus"></i> 新增收货地址</a> 您已创建<span class="addressNum"></span>个收货地址</div>
            @{var number = 1;}
            @foreach (var item in Model)
            {
            <dl class="section">
                <dt class="caption">
                    <i class="fa fa-home"></i> 收货地址 <em>@number</em>
                </dt>
                <dd class="sectionC">
                    <p>收货人： @item.ShipTo</p>
                    <p>地区：@item.RegionAddress 地址：@Html.Raw(@item.Address)</p>
                    <p>手机：@item.CellPhone 联系电话：@item.TelPhone</p>
                  @*  <p>邮编： @item.Zipcode</p>*@
                </dd>
                <span class="btnalter">
                    <a class="modify" href="#ShippingAddressEditor" onclick="modifyShippingAddress(@item.ShippingId)"><i class="fa fa-pencil"></i> 编辑</a>
                    <a class="delete delThisAddress" href="javascript:;" data-userid="@WebClientContext.Current.UserId" data-shippingid="@item.ShippingId"><i class="fa fa-trash"></i> 删除</a>
                </span>
                @if (item.IsDefault == true)
                {
                  <span class="myDefaultAddress">默认收货地址</span>
                }
            </dl>

                number++;
            }
            <div class="addNewAddressBar"><a class="addNewAddress" href="#ShippingAddressCreator"><i class="fa fa-plus"></i> 新增收货地址</a> 您已创建<span class="addressNum"></span>个收货地址</div>
        </div>
    </div>
</div>
<div id="ShippingAddressCreator">
    <form id="shippingAdressCreateForm" method="post" action="~/MyAccount/ShippingAddressCreate?action=@Request.QueryString["action"]">
        <h3>新建收货地址</h3>
        <div class="item">
            <label>收货联系人：</label>
            <input type="text" datatype="s" class="cmnTInput" maxlength="10" name="ShipTo" placeholder="请填写准确的收货联系人" />
            <span class="require">*</span>
        </div>
        <div class="item">
            <label>手机：</label>
            <input type="text" class="cmnTInput" name="CellPhone" placeholder="请填写正确的手机号码" >
            <span class="require">*</span>
        </div>
        <div class="item">
            <label>联系电话：</label>
            <input type="text" datatype="s" class="cmnTInput" name="TelPhone" placeholder="请填写联系电话,以供配送联系使用">
        </div>
        <div class="item">
            <label>地区：</label>
            <select name="region" id="region">
                <option value="" selected="selected">省份</option>
            </select>
            <select name="city" id="city">
                <option value="">城市</option>
            </select>
            <select name="county" id="county">
                <option value="">区县</option>
            </select>
            <input type="hidden" name="RegionId" id="RegionId">
            <span class="require">*</span>
        </div>
        <div class="item">
            <label>收货地址：</label>
            <input type="text" name="Address" class="cmnTInput inputL" maxlength="30" placeholder="请填写该联系地址,以供配送准确到达">
            <span class="require">*</span>
        </div>
      @*  <div class="item">
            <label>邮编：</label>
            <input type="text" name="Zipcode" class="cmnTInput" placeholder="请正确填写邮编">
            <span class="require">*</span>
        </div>*@
        <div class="item-setDefault">
            <input type="checkbox"  name="IsDefault" value="True" >
            <label for="selectDefault">作为默认地址</label>
        </div>
        <div class="btnGroup"><input type="submit" value="提交信息" class="rjbtn rjbtnGreen">
            <button class="rjbtn rjbtnGray cancel"  type="button" onclick="javascript: $.fancybox.close();">取消</button></div>
    </form>
</div>
<div id="ShippingAddressEditor">
    <form id="shippingAddressModifyForm" class="registerform" action="~/MyAccount/ShippingAddressEdit?action=@Request.QueryString["action"]" method="POST">
        <h3>编辑收货地址</h3>
        <div class="item">
            <label>收货联系人：</label>
            <input type="text" class="cmnTInput" id="txtShipTo" name="ShipTo" maxlength="10" placeholder="请填写准确的收货联系人" />
            <span class="require">*</span>
        </div>
        <div class="item">
            <label>手机：</label>
            <input type="text" class="cmnTInput" id="txtCellPhone" name="CellPhone" placeholder="请填写正确的手机号码" />
            <span class="require">*</span>
        </div>
        <div class="item">
            <label>联系电话：</label>
            <input type="text" class="cmnTInput" id="txtTelPhone" name="TelPhone" placeholder="请填写联系电话,以供配送联系使用">
        </div>
        <div class="item">
            <label>地区：</label>
            <select name="regionModify" id="regionModify">
                <option value="" selected="selected">省份</option>
            </select>
            <select name="cityModify" id="cityModify">
                <option value="0">城市</option>
            </select>
            <select name="countyModify" id="countyModify">
                <option value="0">区县</option>
            </select>
            <span class="require">*</span>
            <input type="hidden" name="RegionId" id="RegionIdModify">
        </div>
        <div class="item">
            <label>收货地址：</label>
            <input type="text" name="Address" id="txtAddress" class="cmnTInput inputL" maxlength="30" placeholder="请填写该联系地址,以供配送准确到达">
            <span class="require">*</span>
        </div>
       @* <div class="item">
            <label>邮编：</label>
            <input type="text" name="Zipcode" id="txtZipcode" placeholder="请正确填写邮编" class="cmnTInput">
            <span class="require">*</span>
        </div>*@
        <div class="item-setDefault">
            <input type="checkbox" name="IsDefault"  value="True" id="selectDefaultModify"　>
            <label for="selectDefaultModify">作为默认地址</label>
            <input name="ShippingId" type="hidden" id="hidShippingId">
        </div>
        <div class="btnGroup"><input type="submit" value="提交信息" class="rjbtn rjbtnGreen">
        <button class="rjbtn rjbtnGray cancel" type="button" onclick="javascript: $.fancybox.close();">取消</button></div>
    </form>
</div>
@section footer
{
    <script src="~/Themes/RongJi/Style/plugins/fastconfirm/jquery.fastconfirm.js"></script>
    <script src="~/Utility/pages/RegionSelect.js"></script>
    <script src="~/Utility/pages/RegionSelectModify.js"></script>
    <script src="~/Themes/RongJi/Style/plugins/jQuery.equalHeights.js"></script>
    <script src="~/Themes/RongJi/Style/base/js/account.address.js"></script>
}